<%@ page language="java" import="java.util.*"
 contentType="text/html; charset=utf-8"
pageEncoding="UTF-8"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>
<%
	// 清除session
	@SuppressWarnings("unchecked")
	Enumeration<Object> list = session.getAttributeNames();
	long currentTime = System.currentTimeMillis();
	while (list.hasMoreElements()) {
	    session.removeAttribute(list.nextElement().toString());
	}
%>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
	<head>
		<title>中诚信资讯 | 数据采集系统</title>
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
		<meta http-equiv="X-UA-Compatible" content="IE=7" />
		<meta http-equiv="pragma" content="no-cache"/>
		<meta http-equiv="cache-control" content="no-cache"/>
		<meta http-equiv="expires" content="0"/>
        <script type="text/javascript" src="<%=path %>/js/ui.js"></script>
		<link id="editCss" rel="stylesheet" type="text/css" href="<%=path %>/css/style.css" />
    	<script type="text/javascript">
    		function login(){
    			var form = document.getElementById("myform");
    			form.submit();
    		}
    		
            // 按下回车后出发此事件   
		    function enterPress(e) {  
		        if (e.keyCode == 13) {   
		            doSubmit();   
		        }   
		    }   

	        function fox()
	        {
			    document.getElementById("wordx").focus();
			}
			
			// 表单提交   
		    function doSubmit() { 
		          var user=document.getElementById("wordx").value;
		          var pass=document.getElementById("wordx1").value;
		          var form = document.getElementById("myform");
		          if (user == "") {   
		            alert("请输入账号！");  
		            document.getElementById("wordx").focus();
		            return false;   
		        } else if( pass== "") {  
		            alert("请输入密码！");   
		            document.getElementById("wordx1").focus();
		            return false;  
		        }else{
		           form.submit();
		        }
		    }   
    	</script>
 	</head>
 	
<body class="login" onload="fox()">
<div class="loginBox">

	<form id="myform" name="myform" action="/login" method="post" >
		<input name="session_timestamp" type="hidden" value="<%=currentTime %>" />
		<select name="loginType" id="loginType" class="select_login">
			<option value="customer" selected="selected">客户</option>
			<option value="permissionor">权限系统管理员</option>
			<option value="monitor" >监控系统管理员登陆</option>
		</select>
		<input name="username" type="text" class="writeText" id="wordx" value="monitor"
				onkeydown="enterPress(event);"/>
		<input name="password" maxlength="16" type="password" class="passWord" value="monitor"
				id="wordx1" onkeydown="enterPress(event);"/>
		<a href="javascript:login();" class="btnLogin"></a>
	</form>
</div>
</body>
</html>
